package com.xiqin.microserviceweb.controller.system;

import com.xiqin.microservicebean.system.SystemUser;
import com.xiqin.microserviceservice.system.SystemUserService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author TaoQiansheng
 * @Date 2020-04-29 16:16
 * @Version 1.0
 */
@RestController
@RequestMapping("system")
@Api(tags = "用户管理")
public class SystemUserController {
    @Autowired
    private SystemUserService systemUserService;

    @GetMapping("user")
    @ApiOperation(value="获取用户信息", notes="获取用户信息")
    @ApiImplicitParams({
             @ApiImplicitParam(name="id", value="用户编码", required=true, paramType="query", dataType="String")
    })
    public SystemUser getUserById(@ApiParam(name="id", value="用户ID") Integer id) {
        SystemUser user = systemUserService.selectByPrimaryKey(id);
        System.out.println("user = " + user);
        return user;
    }

}
